{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Population</th>\n",
       "      <th>Profit</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>6.1101</td>\n",
       "      <td>17.5920</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5.5277</td>\n",
       "      <td>9.1302</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>8.5186</td>\n",
       "      <td>13.6620</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>7.0032</td>\n",
       "      <td>11.8540</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5.8598</td>\n",
       "      <td>6.8233</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Population   Profit\n",
       "0      6.1101  17.5920\n",
       "1      5.5277   9.1302\n",
       "2      8.5186  13.6620\n",
       "3      7.0032  11.8540\n",
       "4      5.8598   6.8233"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "path =  'ex1data1.txt'#加载文件\n",
    "data = pd.read_csv(path, header=None, names=['Population', 'Profit'])\n",
    "#pandas库pd.read_csv操作可以读取分隔符csv文件和文本text文件，filepath_or_buffer:顾名思义，您读取的文件路径,URL（包含http,ftp,s3）链接等\n",
    "# sep：指定分隔符，默认为逗号',如果不指定参数，则会尝试使用逗号分隔。分隔符长于一个字符并且不是‘\\s+’,将使用python的语法分析器。\n",
    "# 正则表达式中\\s匹配任何空白字符，包括空格、制表符、换页符等等, 等价于[ \\f\\n\\r\\t\\v]，而“\\s+”则表示匹配任意多个上面的字符。\n",
    "# header：指定哪一行作为表头。默认设置为0（即第一行作为表头），如果没有表头的话，要修改参数，设置header=None\n",
    "# names：指定列的名称，用列表表示。一般我们没有表头，即header=None时，这个用来添加列名就很有用啦！\n",
    "data.head()#用来查看前5行数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Population</th>\n",
       "      <th>Profit</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>97.000000</td>\n",
       "      <td>97.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>8.159800</td>\n",
       "      <td>5.839135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>3.869884</td>\n",
       "      <td>5.510262</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>5.026900</td>\n",
       "      <td>-2.680700</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>5.707700</td>\n",
       "      <td>1.986900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>6.589400</td>\n",
       "      <td>4.562300</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>8.578100</td>\n",
       "      <td>7.046700</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>22.203000</td>\n",
       "      <td>24.147000</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Population     Profit\n",
       "count   97.000000  97.000000\n",
       "mean     8.159800   5.839135\n",
       "std      3.869884   5.510262\n",
       "min      5.026900  -2.680700\n",
       "25%      5.707700   1.986900\n",
       "50%      6.589400   4.562300\n",
       "75%      8.578100   7.046700\n",
       "max     22.203000  24.147000"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.describe()#data.describe( )：describe() 函数可以查看数据的基本情况，包括：count 非空值数、mean 平均值、std 标准差、max 最大值、min 最小值、（25%、50%、75%）分位数等。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAs0AAAHgCAYAAABelVD0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nO3dfZClWV0n+O+5VdlZCdlAmgUIVc20O8XsLLjV5UwtOFvODOCuAYwWOqWGjM4ys4ZohDgS81Ll6O4I6z92KU7oyLqBwooG4+iaYrUO7mjQGCxEiFZ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SypUkl5N8Osnbs7xt7C8nSa31/iTTpZRn9q5/qdZ6vdb6+STvS/KSbTzWt5dSPpzkj5O8OMmLGq7/dUneXWv9Uq11IclvJPn7vcv+31rrld73DyS5exvjABhZh9seAMABdb3Wemr1gVJKWed6dc2/q4/fzO3FjyNrb1xK+aok/zrJf1drvVZK+cX1rrf2Zptctrjq+1tJtGcAB4JKM8DweH+S70yW+5WTfL7W+sXeZa8ppRwppUwneVmSP0ryqSQvKqWM9yrSX7/OfT4jyZeSfKGU8twst4KseDzJnRuM45tLKU8rpTw9ybdkue8a4MBSaQYYHm9K8n+WUmaT/HWS16267A+T/OckL0jyY7XWzyRJKeXXkswm+XiW2y9uU2t9sJTyx0keSvKXST646uK3JfmdUsojq/uaa60f7lWk/7B36BdqrX9cSrl7D/4bAUZSqXXtJ34ADJNSypuSLNRaf7LtsQAcVNozAACggUozAAA0UGkGAIAGQjMAADQQmgEAoIHQDAAADYRmAABoIDQDAECD/x/YvwfU9FKG8AAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 864x576 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "#pandas画图函数，kind='scatter'代表散点图，需指定X轴Y轴\n",
    "data.plot(kind='scatter', x='Population', y='Profit', figsize=(12,8))\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "代价函数：首先，我们将创建一个以参数θ为特征函数的代价函数：\n",
    "$$ J(θ)=\\frac{1}{2m}\\sum\\limits_{i=1}^{m}{{{\\left( {{h}_{\\theta }}\\left( {{x}^{(i)}} \\right)-{{y}^{(i)}} \\right)}^{2}}} $$\n",
    "其中：$${{h}_{\\theta }}\\left( x \\right)={{\\theta }^{T}}X={{\\theta }_{0}}{{x}_{0}}+{{\\theta }_{1}}{{x}_{1}}+{{\\theta }_{2}}{{x}_{2}}+...+{{\\theta }_{n}}{{x}_{n}}$$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "#求J(θ)\n",
    "def computeCost(X, y, theta):#X代表训练集\n",
    "    inner = np.power(((X * theta.T) - y), 2)#theta.T代表theta的转置矩阵\n",
    "    #numpy.power()用于数组元素求n次方，numpy.power(x1, x2) ：x2可以是数字，也可以是数组，但是x1和x2的列数要相同\n",
    "    return np.sum(inner) / (2 * len(X))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "为了考虑截距项（$θ_0 $），我们向X添加额外的第一列，并将其设置为all one。这使得我们可以将$θ_0 $简单地看作另一个“特性”。\n",
    "即：$$ {{h}_{\\theta }}\\left( x \\right)= {{\\theta}_{0}}+ {{\\theta}_{1}{{x}_1}}$$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "data.insert(0, 'Ones', 1,allow_duplicates=True)#在data的指定列中插入数据。\n",
    "# 可选参数，如果dataframe中已经存在某列，将allow_duplicates置为true才可以将指定得列插入。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "初始化数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Ones</th>\n",
       "      <th>Population</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>6.1101</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>5.5277</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>8.5186</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>7.0032</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>5.8598</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   Ones  Population\n",
       "0     1      6.1101\n",
       "1     1      5.5277\n",
       "2     1      8.5186\n",
       "3     1      7.0032\n",
       "4     1      5.8598"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "cols = data.shape[1]#shape函数是numpy.core.fromnumeric中的函数，它的功能是读取矩阵的长度，\n",
    "#比如shape[0]就是读取矩阵第一维度的长度,相当于行数;shape[1]相当于列数\n",
    "X = data.iloc[:,0:cols-1]#提取所有行，从0列到cols-1列的所有数据\n",
    "y = data.iloc[:,cols-1:cols]#提取所有行，从cols-1列到cols列的所有数据\n",
    "#例：data.iloc[[0,1],[0,1]] #提取第0、1行，第0、1列中的数据\n",
    "X.head()#head()是观察前5行"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "查看y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Profit</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>17.5920</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>9.1302</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>13.6620</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>11.8540</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>6.8233</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    Profit\n",
       "0  17.5920\n",
       "1   9.1302\n",
       "2  13.6620\n",
       "3  11.8540\n",
       "4   6.8233"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "代价函数是应该是numpy矩阵，所以我们需要转换X和Y，然后才能使用它们。 我们还需要初始化theta。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "X = np.matrix(X.values)\n",
    "y = np.matrix(y.values)\n",
    "theta = np.matrix(np.array([0,0]))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "看下三个矩阵的维度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((97, 2), (1, 2), (97, 1))"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.shape, theta.shape, y.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "计算代价函数 (theta初始值为0)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "32.072733877455676"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "computeCost(X, y, theta)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 实现批量梯度下降\n",
    "使用梯度下降算法来求出代价函数${{J}({\\theta}_{0},{\\theta}_{1})} $的最小值,\n",
    "批量梯度下降算法的公式如下：\n",
    "$$ {{\\theta }_{j}}:={{\\theta }_{j}}-\\alpha \\frac{\\partial }{\\partial {{\\theta }_{j}}}J\\left( \\theta  \\right)(for\\ j=0\\ and\\ j=1) $$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "def gradientDescent(X, y, theta, alpha, iters):\n",
    "    temp = np.matrix(np.zeros(theta.shape))\n",
    "    parameters = int(theta.ravel().shape[1])\n",
    "    cost = np.zeros(iters)\n",
    "    \n",
    "    for i in range(iters):\n",
    "        error = (X * theta.T) - y\n",
    "        \n",
    "        for j in range(parameters):\n",
    "            term = np.multiply(error, X[:,j])\n",
    "            temp[0,j] = theta[0,j] - ((alpha / len(X)) * np.sum(term))\n",
    "            \n",
    "        theta = temp\n",
    "        cost[i] = computeCost(X, y, theta)\n",
    "        \n",
    "    return theta, cost"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "初始化 学习速率α和要执行的迭代次数。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "alpha = 0.01\n",
    "iters = 1000"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "运行梯度下降算法来将我们的参数θ适合于训练集"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "matrix([[-3.24140214,  1.1272942 ]])"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "g, cost = gradientDescent(X, y, theta, alpha, iters)\n",
    "g"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "最后，使用拟合的参数计算训练模型的代价函数（误差）。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4.515955503078912"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "computeCost(X, y, g)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "绘制线性模型以及数据，直观地看出它的拟合。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAs0AAAHwCAYAAABdQ1JvAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+WH4yJAAAgAElEQVR4nOzde3iV1bn3++8gBA2GGhDogmAERIOgQJBSkbcCurdBuwSkokvoWkIrNi24VCQE3G9Fu/dbAuFYXIIEBdYSUEEMWi2xHgBbjRQNFAFTgUYgnA8BkVByGPuPMZMGzJnM+czD73NduUiezDmfe86g/ObI/dzDWGsREREREZHqNfG6ABERERGRYKfQLCIiIiJSC4VmEREREZFaKDSLiIiIiNRCoVlEREREpBYKzSIiIiIitVBoFpGgZYxZaoz5/3yf/8gYkxeg81pjTJcAnCfRGJNrjPnGGPOfxpiFxphf+/u8wcYYM9AYs/8S7u/J62aMOWOM6Rzo84qINxSaReSSGGPyjTFFvgBx2BizxBgT29jnsdZ+ZK1NrEM9o40xf2rs81d6/PXGmHO+53vMGLPGGNOugQ83CVhvrW1hrf2dtTbFWvv/+s5zSUGyoYwxzxhjin3Pr9AY87Expl+g66hOVT/f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EBERkXDnz+kZBngR2GmtnV3peLtKN7sX+MJfNfhbVFQUvXr14sYbb2TEiBGcPXu2wY81evRoVq9eDcDDDz/Mjh07qr3t+vXr+fjjjyu+XrhwIf/93//d4HOLiIiISM382dPcH/h3YJsxZovv2FPAg8aYXoAF8oFf+LEGv4qJiWHLFvfURo0axcKFC5kwYULF90tLS4mKiqr34y5evLjG769fv57Y2FhuvfVWAFJSUup9DhERERGpO7+tNFtr/2StNdbaHtbaXr6Pd6y1/26tvcl3fIhvykbI+9GPfsSuXbtYv349gwYNYuTIkdx0002UlpaSmprKD37wA3r06MELL7wAuAvoxo8fT7du3fjxj3/MkSNHKh5r4MCBFTsgrlu3jt69e9OzZ0/uuOMO8vPzWbhwIXPmzKFXr1589NFHPPPMM8yc6Sb4bdmyhVtuuYUePXpw7733cvLkyYrHTEtLo2/fvlx//fV89NFHAX6FREREREJXSGyjXavHH4ctW2q/XX306gVz59bppiUlJfzhD39g8ODBAGzatIkvvviCTp06sWjRIq688kr+8pe/8I9//IP+/ftz5513kpubS15eHtu2bePw4cN069aNn/3sZxc87tGjRxk7diwbN26kU6dOnDhxglatWpGSkkJsbCwTJ04E4P3336+4z3/8x38wf/58BgwYwNNPP82zzz7LXN/zKCkpYdOmTbzzzjs8++yzvPfee43xSomIiIiEvfAIzR4pKiqiV69egFtp/vnPf87HH39M3759K8avvfvuu/z1r3+t6Fc+deoUX331FRs3buTBBx8kKiqK9u3bc/vtt3/n8XNycrjtttsqHqtVq1Y11nPq1CkKCwsZMGAAAA899BAjRoyo+P7w4cMBuPnmm8nPz7+0Jy8iIiISQcIjNNdxRbixVe5pruyKK66o+Nxay/z580lOTr7gNu+8806tUyestY06meKyyy4D3AWMJSUljfa4IiIiIuHO73OaI11ycjILFiyguLgYgL/97W98++233HbbbbzyyiuUlpZy8OBBPvzww+/ct1+/fmzYsIG///3vAJw4cQKAFi1a8M0333zn9ldeeSUtW7as6Ff+n//5n4pVZxERERFpuPBYaQ5iDz/8MPn5+fTu3RtrLW3atCErK4t7772XDz74gJtuuonrr7++ynDbpk0bFi1axPDhwykrK6Nt27b88Y9/5J577uG+++5j7dq1zJ8//4L7LFu2jJSUFM6ePUvnzp1ZsmRJoJ6qiIiISNgy1lqva6hVnz59bPk0iXI7d+7khhtu8KgiuZh+HiIiInKpsnILyMjO40BhEe3jYkhNTmRYUnxAazDGfGat7XPxca00i4iIiIjnsnILmLJmG0XFpQAUFBYxZc02gIAH56qop1lEREREPJeRnVcRmMsVFZeSkZ3nUUUXUmgWEREREc8dKCyq1/FAU2gWEREREc+1j4up1/FAU2gWEREREc+lJicSEx11wbGY6ChSkxM9quhCuhBQRERERDxXfrGf19MzqqPQ3EDHjx/njjvuAODQoUNERUXRpk0bADZt2kSzZs0a9Lh33303K1asIC4u7pLqy8/P54YbbqBr166cO3eOFi1aMG7cOB566KEa77dlyxYOHDjA3XfffUnnFxEREamvYUnxQROSL6bQ3EBXXXVVxRbazzzzDLGxsUycOLHi+yUlJTRtWv+X95133mm0Gq+99lpyc3MB2LNnT8UmKWPGjKn2Plu2bGHz5s0KzSIiIiKVRExPc1ZuAf3TP6DT5Lfpn/4BWbkFjX6O0aNHM2HCBAYNGkRaWhqbNm3i1ltvJSkpiVtvvZW8PDcyZenSpQwfPpzBgwdz3XXXMWnSpIrH6NixI8eOHatYKR47dizdu3fnzjvvpKjIXT36l7/8hR49etCvXz9SU1O58cYba62tc+fOzJ49m9/97ncAVdZ2/vx5nn76aV599VV69erFq6++Wu1zEBEREYkkEbHSHMhh2X/729947733iIqK4vTp02zcuJGmTZvy3nvv8dRTT/H6668DbkU3NzeXyy67jMTERB599FGuvvrqCx7rq6++YuXKlWRmZnL//ffz+uuv89Of/pQxY8awaNEibr31ViZPnlzn2nr37s2XX34JQNeuXaus7Te/+Q2bN2/mueeeA6jxOYiIiIhEiogIzTUNy27s0DxixAiiotyVn6dOneKhhx7iq6++whhDcXFxxe3uuOMOrrzySgC6devG119//Z3Q3KlTJ3r16gXAzTffTH5+PoWFhXzzzTfceuutAIwcOZLf//73daqt8pbpNdVWWV1vJyIiIhLOIqI9I5DDsq+44oqKz3/9618zaNAgvvjiC9566y3OnTtX8b3LLrus4vOoqChKSkq+81hV3aZy8K2v3Nxcbrjhhlprq6yutxMREREJZxERmr0aln3q1Cni491K9tKlSxvlMVu2bEmLFi3IyckB4JVXXqnT/fLz85k4cSKPPvpojbW1aNGCb775puJrfzwHERERkVATEaHZq2HZkyZNYsqUKfTv35/S0tLa71BHL774Io888gj9+vXDWlvR5nGx3bt3k5SUxA033MD999/Po48+WjE5o7raBg0axI4dOyouBPTXcxAREREJJeZSft0fKH369LGbN2++4NjOnTsrWg3qIiu3IGiHZdfXmTNniI2NBSA9PZ2DBw8yb948T2uq789DREREJBgZYz6z1va5+HhEXAgIwT0su77efvttpk2bRklJCddcc43aJkRERET8LGJCczh54IEHeOCBB7wuQ0RERCRiRERPs4iIiIjIpQjp0BwK/diRQD8HERERCXchG5ovv/xyjh8/rsDmMWstx48f5/LLL/e6FBERERG/Cdme5g4dOrB//36OHj3qdSkR7/LLL6dDhw5elyEiIiLiNyEbmqOjo+nUqZPXZYiIiIjHwmmsrASvkA3NIiIiIlm5BUxZs42iYrcBV0FhEVPWbANQcJZGFbI9zSIiIiIZ2XkVgblcUXEpGdl5HlUk4UqhWURERELWgcKieh0XaSiFZhEREQlZ7eNi6nVcpKEUmkVERCRkpSYnEhMddcGxmOgoUpMTPapIwpUuBBQREZGQVX6xn6ZniL8pNIuIiEhIG5YUr5Asfqf2DBERERGRWig0i4iIiIjUQqFZRERERKQWCs0iIiIiIrVQaBYRERERqYWmZ4iIiIh4JCu3QOPyQoRWmkVEREQ8kJVbwJQ12ygoLMICBYVFTFmzjazcAq9L89bevZCd7XUV36HQLCIiIuKBjOw8iopLLzhWVFxKRnaeRxV5bMcOGD0arr3W/VlS4nVFF1BoFhEREfHAgcKieh0PWzk5MGwYdO8Or70Gv/qVO9Y0uLqIg6saERERkQjRPi6GgioCcvu4GA+qCTBrXQtGejps2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vfL3L0vhXYAQM0jNANA+n4l6RQzO9rMusxsnZk9YWZnSZKZzTWze8xslZk9b2afCo9faGb/kXkTM/tXM7s2983NbKGZdZvZRjP7SnjsHxVsBrDazFaHx7ZmtrA3s8+Go+AbzOym8NhYM3vOzO4O3+sRM2urbNcAQG0gNANAisxshKRLFeyE9xVJPe5+lqQvSPpx1qlnSXq/pHdJ+pKZnZDgY77o7pPC97jAzM5y929J2iHpIne/KKdN50j6uKTzJE2W9Ckzmxg+faqk77j7BEl9ki5P9BcGgDpFaAaAdLSZ2dOSuiVtk/R9BdvG3iNJ7r5K0mgzOzI8f5m797v7LkmrJZ2b4LOuMLO1knokTZB0esz575G01N3/5O67JS2RdH743Ivu/nT4eI2ksQnaAQB1a0TaDQCAJtXv7mdnHzAzy3Oe5/yZfXyfhg5+HJb7YjMbJ+nzkv7S3V81s8X5zst9WYHn3sh6PCiJ8gwATYGRZgCoHb+UdJUU1CtL2uXur4fPTTezw8xstKQLJT0l6SVJp5vZW8IR6fflec8jJP1J0mtmdpyCUpCMP0o6PKIdnWY20sxGSfqwgrprAGhajDQDQO2YK+mHZrZO0h5J12Q996SkhySNkXSru++QJDP7maR1kp5XUH4xhLs/Y2Y9kjZKekHSY1lPf0/Sw2a2M7uu2d3XhiPST4aHFrl7j5mNLcPfEQDqkrnn/osfAKCWmNlcSbvd/etptwUAmhXlGQAAAEAMRpoBAACAGIw0AwAAADEIzQAAAEAMQjMAAAAQg9AMAAAAxCA0AwAAADEIzQAAAECM/wdbjeBPxeOWkgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 864x576 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "x = np.linspace(data.Population.min(), data.Population.max(), 100)\n",
    "f = g[0, 0] + (g[0, 1] * x)\n",
    "\n",
    "fig, ax = plt.subplots(figsize=(12,8))\n",
    "ax.plot(x, f, 'r', label='Prediction')\n",
    "ax.scatter(data.Population, data.Profit, label='Traning Data')\n",
    "ax.legend(loc=2)\n",
    "ax.set_xlabel('Population')\n",
    "ax.set_ylabel('Profit')\n",
    "ax.set_title('Predicted Profit vs. Population Size')\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
